 #!/usr/bin/python
 # -*- coding: utf-8 -*-
 
 # Echo client program

import socket
import os

ANOMALYHOST = '' # ip of AnomalyChecker
ANOMALYPORT = 8760 # port to send AnomalyChecker

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((ANOMALYHOST, ANOMALYPORT))
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
while 1:
	data = conn.recv(1024)	# recv from java application
	#print (data==None)
	if not data: break
	conn.send("OK")	# send the data received to the java application
	conn.close()
	li=data.split(',')
	li=map(lambda x: x.strip(),li) ## take out the whitespace
	print li
	break
s.close()